package jinyilw.swing.rlaf.ui;

import jinyilw.swing.rlaf.utils.RBorderFactory.EmptyBorder;

import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicComboBoxEditor;

/**
 * @author Jinyi
 */
public class RComboBoxEditor extends BasicComboBoxEditor implements UIResource
{
	private static final Border border = new EmptyBorder(0, 7, 0, 0);
	@Override
	public JTextField createEditorComponent()
	{
		JTextField f = new TransTextField("", 9);
		f.setName("ComboBox.textField");
		return f;
	}

	private static class TransTextField extends JTextField
	{
		private static final long serialVersionUID = 6494529151095382198L;

		public TransTextField(String string, int i)
		{
			super(string, i);
			setOpaque(false);
			setBorder(border);
		}

//		@Override
//		public void updateUI()
//		{
//			setUI(new BasicTextFieldUI());
//		}
	}
}
